﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainFrm.Master" AutoEventWireup="true" CodeBehind="Authorization.aspx.cs" Inherits="Ewts.Storage.Authorization" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<%--<link rel="stylesheet" href="/jquery/jquery.dataTables.css"type="text/css" />
 
<script type="text/javascript" src="/jquery/jquery-1.8.3.min.js"></script>
 
<script type="text/javascript" src="/jquery/jquery.dataTables.js"></script>
<style type="text/css">
    .blue{color:Blue;}
    .ccc{color:#ccc;}
</style>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="EwtsConext" runat="server">
<div class="tab1">
	<h2>授权</h2><input type="hidden" class="hidUname" runat="server" id="txtUserName" /><input type="hidden" class="hidTname" runat="server" id="hidTname" />
    <!--一个表单-->
<br />
<div class="shadow">
 
    <table id="tbColl" class="display" cellpadding="0" cellspacing="0" border="0" style="width:100%;">
 
      <thead>
 
 <tr>
        <th>序号</th>
        <th>LoadNum</th>
        <th>CJO</th>
        <th>客户编码</th>
        <th>客户名称</th>
        <th>货物件数</th>
         <th>其他要求</th>
         <th>状态</th>
       <th>操作</th>

      </tr> 
      </thead>
 
      <tbody>
 
    </tbody>
 
    </table>
</div>
    <script type="text/javascript">
        $(document).ready(function () {



            var mtable = $('#tbColl').dataTable({ "oLanguage": { "sUrl": "/jquery/jquery.dataTable.cn.txt" },
                "bJQueryUI": true,
                "sPaginationType": "full_numbers",
                'bPaginate': true,
                "bProcessing": true,
                "iDisplayLength": 25,
                "bDestory": true,
                "columns": [
                    { "data": "indexnum" },
                    { "data": "loadnum" },
                    { "data": "cjono" },
                    { "data": "cumcode" },
                    { "data": "cumname" },
                    { "data": "numberestimate" },
                    { "data": "peculiarrequire" },
                    { "data": "cjostatus" },
                    { "data": "cjoagree" }
                  ],
                "sAjaxSource": "/ashx/pageJuqery.ashx?pagetype=cjostatus&uname=" + $(".hidUname").val() + "&tname=" + $(".hidTname").val(),
                "bServerSide": true
            });
        });

        function Auth(obj, cjoid) {
            if (confirm("确认授权吗？")) {
                $.ajax({
                    type: "post",
                    url: "/ashx/cjoOper.ashx?opettype=auth&cjoid=" + cjoid,
                    data: { d: "3" },
                    success: function (msg) {
                        if (msg == 4) {
                            alert('已提交，可拆解');
                            var strhtml = "<span><a style='color:ccc;' title='授权拆解'>授权</a><a title='授权撤销申请'onclick='AuthCancel(this," + cjoid + ")' style='color:blue;'>撤销申请</a><span>";                
                            $(obj).parent().html(strhtml);
                        }
                        else {
                        }
                    }
                });
            }
        }

//          string agree1 = "<span><a onclick='Auth(this," + et.cjoid.ToString() +  ")' style='color:blue;' title='授权拆解'>授权</a><a title='授权撤销申请' style='color:#ccc;'>撤销申请</a><span>";
//                string agree2 = "<span><a style='color:ccc;' title='授权拆解'>授权</a><a title='授权撤销申请'onclick='AuthCancel(this," + et.cjoid.ToString() + ")' style='color:blue;'>撤销申请</a><span>";                


        function AuthCancel(obj, cjoid) {
            if (confirm("确认撤销授权吗？")) {
                $.ajax({
                    type: "post",
                    url: "/ashx/cjoOper.ashx?opettype=authcancel&cjoid=" + cjoid,
                    data: { d: "3" },
                    success: function (msg) {
                        alert(msg);
                        if (msg == -4) {
                            alert('请等待批准');

                            var strhtml = "<span><a style='color:ccc;' title='授权拆解'>授权</a><a title='授权撤销申请' style='color:ccc;' >撤销申请</a><span>";
                            $(obj).parent().parent().html(strhtml);
                        }
                        else {
                        }
                    }
                });
            } 
        }

</script>
  
</div>

</asp:Content>
